<!DOCTYPE html>

<html>

	<head>
		<meta charset="UTF-8">
		<title>跟踪日志</title>
		<script src="js/global1.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">

		var tt36=null;
		$(function(){
			init();
		})
		function mokuai(){
				
				var rid=$("#rrrid").val();
				$.post(globalData.pre+"/MyModules",{
					rid:rid
				},function(res){
					   tt=res; 
					  for ( i in tt){  
						if (tt[i].mid==36) {
							tt36=tt[i].mid; 
						}
				 }
				},"json")
			}
		
		function formatterqiantui(value,row,index){
			if (tt36==36) {
				return "    <a href='javascript:void(0)' onclick='del("+index+")' class='easyui-linkbutton'>删除</a>";
			}else{
				return "未授权"
			}
		}
		//初始化
		function init(){
			 mokuai()
			var minqita = $('#minqita').datebox('getValue');  
			var maxqita = $('#maxqita').datebox('getValue');  
			$('#dg').datagrid({    
			    url:globalData.pre+'/SelectJournal1',    
			    method:"post",
			    pagination:true,
			    singleSelect:true,
			    queryParams: {
			    	sname:$("#sname").val(),
			    	uname:$("#uname").val(),
			    	joperate: $('#joperate').combobox('getValue'),
			    	minqita:minqita,
			    	maxqita:maxqita
				}

			}); 
			$("#ss").form("reset");
		}
		//后面的操作
		function caozuo(value,row,index){
			return "<a href='javascript:void(0)' onclick='cha("+index+")' class='easyui-linkbutton'>查看</a>"			
		}
		
		
		
		//打开查看面板
		function cha(index){
			var data = $("#dg").datagrid("getData");
			var row = data.rows[index];
			//给下拉框赋值
			$("#ssex").combo("setText",row.sreport);
			$("#sreport").combo("setText",row.sreport);
			$("#xg").form("load",row);
			$('#upddiv').window('open'); 
		}
		
		//修改取消
			function quxiao1(){
				$('#upddiv').window('close'); 
			}
			function del(index){
				var data = $("#dg").datagrid("getData");
				var row = data.rows[index];  
				
				$.messager.confirm('确认','您确认想要删除这条记录吗？',function(r){    
				    if (r){    
				    	$.post(globalData.pre+"/delectJournal",{
							jid:row.jid
						},function(res){
							if (res>0) {
								$.messager.alert('提示','删除成功'); 
								init();	
							} else {
								$.messager.alert('警告','删除失败');   
							}
						}) 	
				    }    
				});
			}
			
		</script>
	</head>
	
	<body>
		<form id="ss">
			<label >学生姓名:</label>   
	        <input class="easyui-validatebox" type="text"  id="sname"/>   
	        <label>咨询师姓名:</label>   
	        <input class="easyui-validatebox" type="text"  id="uname"/> 
			<label >操作:</label>  
			 <select id="joperate" class="easyui-combobox"  style="width:173px;"> 
	       		<option value="">---请选择---</option>
			    <option value="增加">增</option>   
			    <option value="删除">删</option>   
			    <option value="修改">改</option>   
			    <option value="其他">其他</option>   
			</select>
			<br>
	        <label>回访时间:</label>   
	        <input  id="minqita"  type= "text" class= "easyui-datebox" required ="required"> </input>  
	        <label>~</label>   
	        <input  id="maxqita"   type= "text" class= "easyui-datebox" required ="required"> </input>  
		
			<a id="btn" href="javascript:void(0)" onclick="init()" class="easyui-linkbutton" data-options="iconCls:'icon-search'">搜索</a>  
			
	</form>
	
		<table id="dg" class="easyui-datagrid"    >   
		     <thead>   
		        <tr>   
		            <th data-options="field:'',checkbox:true">多选</th>   
		            <th data-options="field:'jid'">编号</th>   
		            <th data-options="field:'jdate'">日志时间</th>   
		            <th data-options="field:'jsname'">学生姓名</th>   
		            <th data-options="field:'juname'">员工姓名</th>   
		            <th data-options="field:'jvisdate'">回访时间</th>   
		            <th data-options="field:'jvisit'">回访方式</th>   
		            <th data-options="field:'jreview'">回访情况</th>   
		            <th data-options="field:'jtali'">跟踪方式</th>   
		            <th data-options="field:'jnextdate'">下次跟踪时间</th>  
		            <th data-options="field:'caozuo',formatter:caozuo">操作</th>   
		            <th data-options="field:'sanchu',formatter:formatterqiantui">删除</th>   
		        </tr>   
		    </thead>   
		</table>  	
		
		
	<input class="easyui-validatebox" type="hidden" value="${list.roles.rid}"  id="rrrid"/>
	
	<div id="upddiv" class="easyui-window" style="width:350px;height:400px" title="修改面板" data-options="iconCls:'icon-save',modal:true,closable:true,closed:true">  
			<form id="xg" method="post">   
			<table>
			<tr>
			
					<td>
						<label >编号:</label>
					</td>
					<td> 
						<input class="easyui-validatebox" disabled="disabled" type="text" name="jid"  id="jid" />
					</td>
				</tr>
				<tr>
			
					<td>
						<label >日志时间:</label>
					</td>
					<td> 
						<input class="easyui-validatebox" disabled="disabled" type="text" name="jdate"  id="jdate" />
					</td>
				</tr>
				<tr>
					<td>
						<label >学生id:</label>   
					</td>
					<td>
						<input class="easyui-validatebox" disabled="disabled" type="text" name="jusid"  id="jusid"/>
						
						
					</td>
				</tr>
				<tr>
					<td>
						<label >员工id:</label>
					</td>
					<td>
						<input class="easyui-validatebox" disabled="disabled" type="text" name="jstid"  id="jstid"/>
						
					</td>
				</tr>
				<tr>
					<td>
						<label >回访时间:</label>
					</td>
					<td>
						<input class="easyui-validatebox" disabled="disabled" type="text" name="jvisdate" id="jvisdate"/>
						
					</td>
				</tr>
				<tr>
					<td>
						<label >回访方式:</label>
					</td>
					<td>
						<input class="easyui-validatebox" disabled="disabled" type="text" name="jvisit" id="jvisit"/>
						
					</td>
				</tr>
				<tr>
					<td>
						<label >回访情况:</label>
					</td>
					<td>
						<input class="easyui-validatebox" disabled="disabled" type="text" name="jreview" id="jreview"/>
						
					</td>
				</tr>
				<tr>
					<td>
						<label >跟踪方式:</label>
					</td>
					<td>
						<input class="easyui-validatebox" disabled="disabled" type="text" name="jtali" id="jtali"/>
						
					</td>
				</tr>
				<tr>
					<td>
						<label >下次跟踪时间:</label>
					</td>
					<td>
						<input class="easyui-validatebox" disabled="disabled" type="text" name="jnextdate" id="jnextdate"/>
						
					</td>
				</tr>
				<tr>
					<td>
						<label >备注:</label>
					</td>
					<td>
						<input class="easyui-validatebox" disabled="disabled" type="text" name="jremark" id="jremark"/>
						
					</td>
				</tr>
				<tr>
					<td>
						<label >操作:</label>
					</td>
					<td>
						<input class="easyui-validatebox" disabled="disabled" type="text" name="joperate" id="joperate"/>
						
					</td>
				</tr>
				<tr>
					<td>
					</td>
					<td>
					<a href="javascript:void(0)" onclick="quxiao1()" class="easyui-linkbutton" >确定</a>
					</td>
				</tr>
			</table>
		</form> 
	</div>
	</body>

</html>